
--------------------------------------------------------------------------------
Problem
--------------------------------------------------------------------------------
RegDelete, RegRead and RegWrite operate on the wrong "keyname".

Is this a bug in AutoIt?
Or, maybe I'm failing to understand something about Win7_x64.

--------------------------------------------------------------------------------
Description
--------------------------------------------------------------------------------
This script is a Windows 7_x64 Update installer.
The computer needs to restart several times to install all updates.
The following code snip allows Windows to auto-logon to a user's account.

--------------------------------------------------------------------------------
Code snip: On Win7_x64, this works.
--------------------------------------------------------------------------------
Func UserAccount_AutoLogOn( $AccountName=@UserName, $Password=0 )

    $Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

    RegWrite( $Key, "AutoAdminLogon",  "REG_SZ", "1"          )
    RegWrite( $Key, "DefaultUserName", "REG_SZ", $AccountName )

    If $Password Then
        RegWrite( $Key, "DefaultPassword", "REG_SZ", $Password )
    Else
        RegDelete( $Key, "DefaultPassword" )
    EndIf
EndFunc

--------------------------------------------------------------------------------
Code snip: On Win7_x64, this DOES NOT WORK.
--------------------------------------------------------------------------------
#pragma compile(x64, false)  ;<--- THIS CAUSES THE PROBLEM

Func UserAccount_AutoLogOn( $AccountName=@UserName, $Password=0 )

    $Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

    RegWrite( $Key, "AutoAdminLogon",  "REG_SZ", "1"          )
    RegWrite( $Key, "DefaultUserName", "REG_SZ", $AccountName )

    If $Password Then
        RegWrite( $Key, "DefaultPassword", "REG_SZ", $Password )
    Else
        RegDelete( $Key, "DefaultPassword" )
    EndIf
EndFunc

It does not operate on...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

It operates on...
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon

